//--------------------------------------------------------------
//
// Qizhi Zhang 
// ezhung@gmail.com
// http://www.moorwind.com
//
//--------------------------------------------------------------
package reader.controller
{
	import flash.display.StageDisplayState;
	
	import org.puremvc.as3.multicore.interfaces.ICommand;
	import org.puremvc.as3.multicore.interfaces.INotification;
	import org.puremvc.as3.multicore.patterns.command.SimpleCommand;
	
	import reader.ApplicationFacade;

	public class ScreenCommand extends SimpleCommand implements ICommand
	{
		////////////////////////////////////////////////////////////////////////////////
		//private variables
		private var airReader:Reader;
		
		//////////////////////////////////////////////////////////////////////////////
		//methods
		
		override public function execute(notification:INotification):void
		{
			airReader = notification.getBody() as Reader; 
			if(airReader.stage)
			{
				if(airReader.stage.displayState == StageDisplayState.NORMAL)
				{
					airReader.stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
					sendNotification(ApplicationFacade.SCREEN_CHANGED, StageDisplayState.FULL_SCREEN_INTERACTIVE);
				}			
				else
				{
					airReader.stage.displayState = StageDisplayState.NORMAL;
					sendNotification(ApplicationFacade.SCREEN_CHANGED, StageDisplayState.NORMAL);
				}
			}
		}
		
	}
}